package com.nanuminc.market.utils;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class XMLUtil {
	public static String getXml(String xml) {
    	StringBuilder html = new StringBuilder(); 
    	try{
    		URL url = new URL(xml);
    		HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    		conn.setConnectTimeout(10000);
    		if(conn.getResponseCode() == HttpURLConnection.HTTP_OK)
    		{
    			BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    			for(;;)
    			{
    				String line = br.readLine();
    				if(line == null)
    					break;
    				html.append(line+'\n');
    			}
    			br.close();
    		}
    		conn.disconnect();
    	}catch (Exception ex){;}
    	return html.toString();
	}
}
